import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
// https://vitejs.dev/config/  src  source
export default defineConfig({
  plugins: [
    vue(),
    //element-plus 组件自动按需加载插件
    AutoImport({
      resolvers: [ElementPlusResolver()],
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    }),
  ],
  server:{
    port:3000,
    host:"localhost"
  },
  resolve:{
    alias:{
      '@':path.join(__dirname,'./src'),
      "@views":path.join(__dirname,"./src/views"),
      "@components":path.join(__dirname,'./src/components')
    }
  }
})
